package com.uzai.common.enums;

/**
 * 消息ext类型
 * @Auther: jianghan
 * @Date: 2021/8/14 16:45
 * @Description:
 */
public enum MsgExtTypeEnum {
    FD_TUO(0, "发单-托的上级ID"),
    CHAT_ROOM_AT(1, "群聊@人类型");

    private Integer id;
    private String desc;

    MsgExtTypeEnum(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static MsgExtTypeEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (MsgExtTypeEnum type: MsgExtTypeEnum.values()) {
            if (type.getId().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
